package chapter13.wrapper.String;

/**
 * @Auther: Tx
 * @Date: 2022/5/4 20:03
 */
public class String04 {
    public static void main(String[] args) {
        Person p1 = new Person();
        p1.name = "hspedu";
        Person p2 = new Person();
        p2.name = "hspedu";
        System.out.println(p1.name.equals(p2.name));//true equal方法比较的是值
        System.out.println(p1.name == p2.name);//true 指向的是常量池的同一空间
        System.out.println(p1.name == "hspedu");//true  字符串常量的值存储在常量池中


    }
}
class Person{
    public String name;
    public Person() {

    }
}